package com.hspedu.newData.dmsxl.哈希表;

import org.junit.Test;

import java.util.HashSet;

/**
 * @Author: yh
 * @description:
 * @CreateTime: 2025-04-29
 * @Version: 1.0
 */

public class LC3396使数组元素互补相同所需的最少操作次数 {

    // todo 没看懂
    public int minimumOperations(int[] nums) {

        boolean[] seen = new boolean[128];
        for (int i = nums.length - 1; i >= 0; i--) {
            if (seen[nums[i]]) {
                return i / 3 + 1;
            }
            seen[nums[i]] = true;
        }
        return 0;

    }

    @Test
    public void test() {
        // 测试代码

        minimumOperations(new int[]{1,2,3,4,2,3,3,5,7});
    }
}
